home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac-Source 1994 July
/
Mac-Source_July_1994.iso
/
C and C++
/
Libraries
/
Mac Stdg 4.4 Folder
/
Samples
/
bullmain.c
next >
Wrap
C/C++ Source or Header
|
1994-01-09
|
2KB
|
56 lines
/* Bullseye by Loki */
#include "stdg.h"
#include "bullseye.h"
void about_bullseye(void)
{
mouse m;
window *w = new_window("About Bullseye...", rdiag(25,25,120,50), Modal);
show_window(w);
draw_rect(w->b, insetr(w->b->r, 1), 1, BLACK);
draw_string(w->b, pt(17,7), sys_font, "Stdg Bullseye", BLUE);
draw_string(w->b, pt(34,27), sys_font, "by Loki", BLUE);
do { m = get_mouse(w);} while (!(m.kind & MouseDown)); /* mouse down */
do { m = get_mouse(w);} while (!(m.kind & MouseUp)); /* mouse up */
hide_window(w);
del_window(w);
}
int main(int argc, char **argv)
{
mouse m;
window *w;
/* Initialise our Bullseye menus. See "bullmenu.c" for details */
menuinit();
/* Initialise the Stdg graphics interface, and supply our menubar */
ginit("Bullseye", &adjust_menus, menubar);
/* Now we set up our own About Bullseye... function */
set_aboutbox(&about_bullseye);
/* Create a workspace window and show it on the screen */
w = new_window("Bullseye by Loki", rect(6,44,630,420),
Titlebar | Closebox | Maximize | Resize | Workspace);
show_window(w);
/* Now we handle events, but let the menus do most of the work */
while(1) {
if (can_event() && ((w = active_window) != NULL))
if (can_mouse(w))
{
m = get_mouse(w);
if (m.kind & MouseUp) /* just saw a mouse up event */
hit_window(w); /* tell the window to redraw */
}
}
}